package cn.yunyichina.provider.iface.entity.hisiface.physical;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * 体检报告列表查询
 *
 * @author zhou
 * @date 2017年9月15日
 */
public class PhysicalExamListVoResponse implements Comparable<Object>,Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 5588509267108696464L;

    private String phyExamId;
    private String phyExamName;
    private String phyExamTime;
    
    public String getPhyExamId() {
        return phyExamId;
    }
    public void setPhyExamId(String phyExamId) {
        this.phyExamId = phyExamId;
    }
    public String getPhyExamName() {
        return phyExamName;
    }
    public void setPhyExamName(String phyExamName) {
        this.phyExamName = phyExamName;
    }
    public String getPhyExamTime() {
        return phyExamTime;
    }
    public void setPhyExamTime(String phyExamTime) {
        this.phyExamTime = phyExamTime;
    }
    
    @Override
	public int compareTo(Object o) {
		try{
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			if (this == o) {
				return 0;
			} else if (o != null && o instanceof PhysicalExamListVoResponse) {
				PhysicalExamListVoResponse u = (PhysicalExamListVoResponse) o;
				if (sdf.parse(u.getPhyExamTime()).getTime() < sdf.parse(this.phyExamTime).getTime()) //根据phyExamTime进行排序
					return -1;
				else if (sdf.parse(u.getPhyExamTime()).getTime() == sdf.parse(this.phyExamTime).getTime())
					return -1;
				else
					return 1;	
			} else {
				return -1;
			}
		
		}catch(ParseException e){
			
		}
		return -1;
	}
}
